<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>时钟</title>
</head>
<style>
    div {
        text-align: center;
        margin-top: 150px;
    }
</style>

<body>
    <div>
        <canvas id="clock" width="500px" height="500px"></canvas>
    </div>
    <script>
        let dom = document.getElementById('clock');//获取画布
        let ctx = dom.getContext('2d'); //获取canvas上下文 
        let ww = ctx.canvas.width;//获取预先设置的canvas画布宽度
        let wh = ctx.canvas.height; //获取预先设置的canvas画布高度
    </script>
</body>

</html>